<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="demo">
    <p v-if="ok">表白成功</p>
    <p v-else>表白失败</p>

    <button @click="ok = !ok">切换</button>
  </div>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
  <script>
    new Vue({
      el: '#demo',
      data: {
        ok: true
      }
    })
  </script>
</body>
</html>